package com.bw.module_login.model

import com.bw.lib_common.entity.Res
import com.bw.module_login.api.LoginApiServer
import com.bw.lib_common.entity.UserEntity
import com.bw.lib_common.model.BaseRepository
import com.bw.lib_http.OkHttpClientManager

/**
 * 登录接口的repo实例
 */

class LoginRepository : BaseRepository<LoginApiServer>() {

    override fun createApiServer(): LoginApiServer = OkHttpClientManager.retrofitInstance.create(
        LoginApiServer::class.java)
    suspend fun loginToServer(password:String,username:String): Res<UserEntity> = apiService.loginToServer(password,username)

    suspend fun registerToServer(password:String,username:String):Res<UserEntity> = apiService.registerToServer(password,username)

}
